package com.limespot.api.misc;

import com.limespot.api.Bootstrap;
import com.limespot.api.User;

public abstract class AbstractMain {
	
	private User user;
	
	public abstract void realMain();
	
	protected final User getUser() {
		return user;
	}
	
	protected final void setUser(User user) {
		this.user = user;
	}
	
	protected final void setUser(String username) {
		setUser(Bootstrap.getFactory().newUser(username));
	}

	public final void realMain(String[] args) {
		
		String username = args.length == 0 ? "spudtrooper" : args[0];
		setUser(username);
		
		realMain();
	}
}
